Catch the case where a CSS style did not change and don't emit the
style-changed signal in that case.
This saves not only the emission of the signal, but also doesn't cause
invalidation in child nodes, which would previously get a PARENT_STYLE
GtkCssStyle *style)
{
GtkCssStyleChange change;
+ gboolean style_changed;
if (cssnode->style == style)
return FALSE;
gtk_css_style_change_init (&change, cssnode->style, style);
- g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
+ style_changed = gtk_css_style_change_has_change (&change);
+ if (style_changed)
+ g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
gtk_css_style_change_finish (&change);
- return TRUE;
+ return style_changed;
}
static void